/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author alumno
 */
@Embeddable
public class PersonalUnidadPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "UNI_COD")
    private short uniCod;
    @Basic(optional = false)
    @Column(name = "PER_COD")
    private int perCod;
    @Basic(optional = false)
    @Column(name = "PER_UNI_COD")
    private int perUniCod;

    public PersonalUnidadPK() {
    }

    public PersonalUnidadPK(short uniCod, int perCod, int perUniCod) {
        this.uniCod = uniCod;
        this.perCod = perCod;
        this.perUniCod = perUniCod;
    }

    public short getUniCod() {
        return uniCod;
    }

    public void setUniCod(short uniCod) {
        this.uniCod = uniCod;
    }

    public int getPerCod() {
        return perCod;
    }

    public void setPerCod(int perCod) {
        this.perCod = perCod;
    }

    public int getPerUniCod() {
        return perUniCod;
    }

    public void setPerUniCod(int perUniCod) {
        this.perUniCod = perUniCod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) uniCod;
        hash += (int) perCod;
        hash += (int) perUniCod;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonalUnidadPK)) {
            return false;
        }
        PersonalUnidadPK other = (PersonalUnidadPK) object;
        if (this.uniCod != other.uniCod) {
            return false;
        }
        if (this.perCod != other.perCod) {
            return false;
        }
        if (this.perUniCod != other.perUniCod) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.PersonalUnidadPK[ uniCod=" + uniCod + ", perCod=" + perCod + ", perUniCod=" + perUniCod + " ]";
    }
    
}
